//
//  ChangeLocationStyleView.m
//  sdk2.0zhengquandasha
//
//  Created by Choi on 16/1/11.
//  Copyright © 2016年 palmaplus. All rights reserved.
//

#import "ChangeLocationStyleView.h"
#import "KeyWindowView.h"
@interface ChangeLocationStyleView()
@property (nonatomic,assign)LocationStyle locStyle;
@end

@implementation ChangeLocationStyleView
- (IBAction)btnTZPMP:(UIButton *)sender {
    [self setCurrentLocationStyle:LocationProbeAndPal];
        [KeyWindowView removeFromSuperView:0.5];
}

- (IBAction)btnHCPMP:(UIButton *)sender {
    [self setCurrentLocationStyle:LocationHCAndPal];
        [KeyWindowView removeFromSuperView:0.5];
}

- (IBAction)btnHCYJ:(UIButton *)sender {
    [self setCurrentLocationStyle:LocationHCAndYJ];
        [KeyWindowView removeFromSuperView:0.5];
}

- (IBAction)btnBETPMP:(UIButton *)sender {
    [self setCurrentLocationStyle:LocationBETAndPal];
        [KeyWindowView removeFromSuperView:0.5];
}

- (IBAction)btnBlueTooth:(UIButton *)sender {
    [self setCurrentLocationStyle:LocationBluetooth];
        [KeyWindowView removeFromSuperView:0.5];
}

-(void)setCurrentLocationStyle:(LocationStyle)style{
    self.locStyle = style;
    [self initImage];
    switch (style) {
        case LocationProbeAndPal:
        {
            self.imgTZPMP.image = [UIImage imageNamed:@"ico_xuanze_pre"];
        }
            break;
        case LocationHCAndPal:
        {
            self.imgHCPMP.image = [UIImage imageNamed:@"ico_xuanze_pre"];
        }
            break;
        case LocationHCAndYJ:
        {
            self.imgHCYJ.image = [UIImage imageNamed:@"ico_xuanze_pre"];
        }
            break;
        case LocationBETAndPal:
        {
            self.imgBETPMP.image = [UIImage imageNamed:@"ico_xuanze_pre"];
        }
            break;
        case LocationBluetooth:
        {
            self.imgBlueTooth.image = [UIImage imageNamed:@"ico_xuanze_pre"];
        }
            break;
        default:
            break;
    }
    
    if (self.startLocationBlock) {
        self.startLocationBlock(self.locStyle);
    }
}

-(void)initImage{
    self.imgTZPMP.image = [UIImage imageNamed:@"ico_xuanze"];
    self.imgHCPMP.image = [UIImage imageNamed:@"ico_xuanze"];
    self.imgHCYJ.image = [UIImage imageNamed:@"ico_xuanze"];
    self.imgBETPMP.image = [UIImage imageNamed:@"ico_xuanze"];
    self.imgBlueTooth.image = [UIImage imageNamed:@"ico_xuanze"];
}

@end
